<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
    <link rel="stylesheet" href="../css/productDetail.css">
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/footer.css">
    <title>商品详情</title>
    <header>
        <div>
            <img src="../images/login.png" alt="">
            <form action="">
                <input type="text" value=""class="text">
                <input type="button" value="搜索" class="mybutton">
                </form>
            <ul class="tu">
                <li><span><a href="../html/index.html">首页</a> </span></li>
                <li><span>蛋糕</span></li>
                <li><span>全国配</span></li>
                <li><span>合作专区</span>
                    <ul class="tul">
                        <li>银行活动</li>
                        <li>企业采购</li>
                        <li>大客户区</li>
                    </ul>
                </li>
                <li><span>立即兑换</span></li>
            </ul>
            <a href="../html/login.html" class="d1">登录</a>
            <a href="../html/register.html" class="d2">注册</a>
            <a href="../html/shoppingCar.html" class="d3"><i></i>购物车</a>
            <a href="../html/personal.html" class="d4">个人中心</a>  
            
            
        </div>
    </header>
    <script>
        $(function(){
            $.ajax({
                url:'http://localhost:3000/api/getProductsByProductId?productId=1',
                success:function(result){
                    console.log('res',result)
                    var data = result.data
                    $('.imgProduct').attr('src','http://localhost:3000/' + data[0].products.xqImg)
                    $('.productTitle').html(data[0].products.name)
                    $('.productTitle2').html(data[0].products.name)
                    $('.productPrice').html(data[0].products.size)
                    $('.buy').html(data[0].products.pay)
                    $('.car').html(data[0].products.addshoppingCar)
                    $('.productService').html(data[0].products.service)
                    $('.productselectSize').html(data[0].products.selectSize)
                    $('.productNumber').html(data[0].products.number)
                    $('.productxq').html(data[0].products.detail)
                    $('.productBrand').html(data[0].products.brand)
                    $('.productExp').html(data[0].products.exp)
                    $('.productBatching').html(data[0].products.batching)
                    $('.productProduction').html(data[0].products.production)
                    $('.productConditions').html(data[0].products.conditions)
                    $('.productjianjie').attr('src','http://localhost:3000/' + data[0].products.jianjie)
                    $('.productjianjie2').attr('src','http://localhost:3000/' + data[0].products.jianjie2)
                    var strHTML = ''
                    for(var i = 0 ; i < data.length ; i++){
                        strHTML +=`
                        <li>
                            <img class="userheadPic" src="http://localhost:3000/${data[i].users.headPic}">
                            <p class = "userName">昵称：${data[i].users.name}</p>
                            <p class = "commentContent">评论：${data[i].content}<p>
                            <p class = "commentTime">日期：${data[i].commentTime}<p>
                        </li>
                        `
                    }
                    $('.comments').html(strHTML)
                }
            })
        })
    </script>
</head>
<body>
    <div class="contenCon">
        <h3><span class="productTitle"></span></h3>
        <img class="imgProduct" src="" alt="" >
        <h3><span class="productPrice"></span></h3>
        <h3><span class="productService"></span></h3>
        <h3><span class="productNumber"></span></h3>
        <h3><span class="productselectSize"></span></h3>
        <a href="pay.html" class="buy"></a>
        <a href="../html/shoppingCar.html" class="car"></a>
        <h2 class="productxq"></h2>
        <hr>
        <h3>品名：<span class="productTitle2"></span></h3>
        <h3>品牌：<span class="productBrand"></span></h3>
        <h3>保质期：<span class="productExp"></span></h3>
        <h3>配料：<span class="productBatching"></span></h3>
        <h3>产地：<span class="productProduction"></span></h3>
        <h3>贮存条件：<span class="productConditions"></span></h3>
        <img class="productjianjie" src="" alt="" >
        <img class="productjianjie2" src="" alt="" >
        <hr><br>
        <h3><span class="pingjia">用户评价</span></h3>
        <ul class="comments">
        </ul>
    </div>
    <footer>
        <div class="footer">
            <img class="footer-logo" src="../images/logo.png" height="23" width="200" alt="">
            <div class="footer-nav">
                <a>诺心公告</a>
                <span>|</span>
                <a>关于诺心</a>
                <span>|</span>
                <a>客服服务</a>
                <span>|</span>
                <a>生产经营资质</a>
                <span>|</span>
                <a>公告专区</a>
            </div>
            <div class="footer-icon">
                <a href="http://weibo.com/21cake" target="_blank">
                    <img src="../images/footericon-01.png">
                </a>
                <a class="footer-weixin">
                    <div class="footer-erweima footer-weixin-erweima">
                        <img src="../images/erweima.png">
                    </div>
                    <img src="../images/footericon-02.png">
                </a>
                <a class="footer-app">
                    <div class="footer-erweima footer-app-erweima">
                        <img src="../images/erweima.png">
                    </div>
                    APP
                </a>
            </div>

            <div class="footer-text">
                <span>订购专线：4001-578-578（服务时间 09:00–21:00）</span>
                <span>客服电话：021-23099721（全国） | services@lecake.com（邮箱）</span>
                <span>杭州/广州：提前5小时预订；北京：提前6小时预订；上海：提前5.5-6小时预订；天津/苏州/无锡/深圳：提前8小时预订（部分偏远地区除外，当日22点以后订单，于次日8点开始审核） </span>
                <span>当日蛋糕配送截止下单时间：北京：16:50；上海：16:30；杭州/广州：13:50；天津：10:30；苏州/无锡/深圳：11:00</span>
                <span>网站注册公司名称: 诺心食品（上海）有限公司  地址: 上海市徐汇区虹漕路68号锦和中心7楼A、C单元 </span>
            </div>
            <div class="footer-copyright">
                <span>Copyright© 诺心leCake蛋糕官网商城 2010-2022, 版权所有 <a style="color: #9a9a9a" target="_blank" href="https://beian.miit.gov.cn/#/Integrated/index">沪ICP备10211730号-2</a></span>
            </div>
        </div>
    </footer>
</body>
</html>